﻿using UnityEngine;
using Yoozoo.Gameplay.Liberty.AI;

namespace Yoozoo.Gameplay.Liberty.PlayerController
{
    public class PlayerEntity : MonoBehaviour
    {
        [SerializeField]
        private AIEntity aiEntity;
        public AIEntity AIEntity => aiEntity;

        private void Awake()
        {
            SyncData();

            BlueprintUtils.PlayerEntity = this;
        }

        private void OnDestroy()
        {
            BlueprintUtils.PlayerEntity = null;
        }

        public void SyncData()
        {
            aiEntity.data.position = aiEntity.viewer.transform.position;
            // aiEntity.data.forward = aiEntity.viewer.transform.rotation;
        }
    }
}
